package cc.magicjson.spring.boot.autoconfigure;

import cc.magicjson.spring.boot.domain.Person;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * {@link Person}
 *
 * @author <a href="mailto:it_magicjson@163.com">MagicJson</a>
 * @since 1.0.0
 */
@AutoConfigureOrder
@ConditionalOnWebApplication
@ConditionalOnProperty(prefix = "person",name = "enable", havingValue = "true")
public class PersonAutoConfiguration {

    @Bean
    @ConfigurationProperties(prefix = "person")
    public Person person(){
        return new Person();
    }
}
